home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 27 / CU Amiga Magazine's Super CD-ROM 27 (1998)(EMAP Images)(GB)[!][issue 1998-10].iso / CUCD / Programming / JForth / Textra120 / Scripts / Tutorial.textra < prev    next >
Encoding:
Text File  |  1997-08-16  |  22.6 KB  |  642 lines

  1.     /*******************************************************************
  2.      *   TEXTRA AREXX script -- Mike Haas, ©1993, All Rights Reserved. *
  3.      * Freely distributable ONLY as a component of the TEXTRA package. *
  4.      * This banner may not be removed or altered (improvements to the  *
  5.      *    actual program welcome).  Please document and send to me.    *
  6.      *        !!! PLACE THIS FILE IN YOUR REXX: DIRECTORY !!!          *
  7.      *******************************************************************/
  8.  
  9. /* Tutorial for TEXTRA (v1.17 required)
  10.  *
  11.  * by Mike Haas
  12.  *
  13.  * This script is a training aid to give the user a sense of the
  14.  * user-interface of the editor.
  15.  *
  16.  * It accepts one optional argument... if the keyword "delay" is
  17.  * supplied, the Tutorial will delay between text pieces spilled
  18.  * to the screen as a 'pacing' mechanism.
  19.  *
  20.  */
  21.  
  22. OPTIONS results
  23.  
  24. rex = 0; result = "NOTSUPPORTED"    /*00002*/
  25. textraversion
  26. parse var result maj min rex
  27. if (result == "NOTSUPPORTED") | (rex < 13) then do
  28.     notify "Textra 1.17 or later required to run this script."
  29.     exit
  30. end
  31.  
  32. parse arg delay
  33.  
  34. openfile "ram disk:Textra Tutorial"; tutwin = result
  35.  
  36. if (tutwin == 0) then do
  37.    notify "Can't open the window"
  38.    exit
  39. end
  40.  
  41. /*clear*/
  42.  
  43. prefs autoindent read
  44. wasai = result
  45. prefs autoindent off
  46.  
  47. setfont "topaz" 8
  48.  
  49. newline;newline;newline
  50. textn '"   NOTE:  You may cancel the tutorial at any time if you..."'
  51. newline
  52. textn '"     1. Pull down the `Utilities, Cancel ARexx Script` menu item"'
  53. textn '"     2. Press RETURN"'
  54. newline;newline;newline;newline
  55. response = getreturn('"   Press RETURN now to start the tutorial..."')
  56.  
  57. quitflag = 0
  58.  
  59. do while (quitflag == 0)
  60.     clear
  61.     newline
  62.     textn '"                 Welcome to the Textra Tutorial"'
  63.     textn '"                 =============================="'
  64.     newline
  65.     textn '"                   A - All topics in sequence"'
  66.     newline
  67.     textn '"    1 - Introduction                  2 - Provided documentation"'
  68.     textn '"    3 - Using the mouse               4 - The text cursor"'
  69.     textn '"    5 - Selecting ranges of text      6 - The window scroll bars"'
  70.     textn '"    7 - Working with selected text    8 - Textra Preferences"'
  71.     textn '"    9 - Textra and Fonts             10 - The ARexx Interface"'
  72.     newline
  73.     textn '"                  R - Really, the best part :-)"'
  74.     newline
  75.     textn '"                        X - Exit tutorial"'
  76.     newline;newline
  77.     response = getreturn('"                         Choose a topic: "')
  78.     
  79.     parse var response stx sty endx endy
  80.     gotoxy stx sty;selectto endx endy
  81.     get select text;parse var result numleft' 'theSelection
  82.     if (numleft == 0) then do
  83.         if ((theSelection == "A") | (theSelection == "a")) then
  84.             call DoSequence
  85.         if (theSelection == 1) then
  86.             call DoIntro
  87.         if (theSelection == 2) then
  88.             call DoDocs
  89.         if (theSelection == 3) then
  90.             call DoMouseInfo
  91.         if (theSelection == 4) then
  92.             call DoPositionCursor
  93.         if (theSelection == 5) then
  94.             call DoSelectRanges
  95.         if (theSelection == 6) then
  96.             call DoScrollBars
  97.         if (theSelection == 7) then
  98.             call DoSelectTextInfo
  99.         if (theSelection == 8) then
  100.             call DoPrefs
  101.         if (theSelection == 9) then
  102.             call DoFonts
  103.         if (theSelection == 10) then
  104.             call DoARexx
  105.         if ((theSelection == "R") | (theSelection == "r")) then
  106.             call DoReg
  107.         if ((theSelection == "X") | (theSelection == "x")) then do
  108.             prefs autoindent wasai
  109.             CloseWindow
  110.             exit
  111.         end
  112.     end
  113. end
  114.  
  115. exit
  116.  
  117.  
  118. DoSequence:
  119.     call DoIntro
  120.     call DoDocs
  121.     call DoMouseInfo
  122.     call DoPositionCursor
  123.     call DoSelectRanges
  124.     call DoScrollBars
  125.     call DoSelectTextInfo
  126.     call DoPrefs
  127.     call DoFonts
  128.     call DoARexx
  129.     call DoReg
  130. return
  131.  
  132.  
  133. DoIntro:
  134. clear;wfs=waitforsub(1);newline;newline
  135. textn  '"                    Welcome to TEXTRA"'
  136. textn  '"                 -----------------------"'
  137. wfs=waitforsub(2)
  138. newline
  139. textn '"     This tutorial is designed to give you a feel for"'
  140. textn '"     what Textra can do by guiding you through some of"'
  141. textn '"     its basic editing operations and features."'
  142. wfs=waitforsub(2)
  143. newline
  144. textn '"     Occasionally, the tutorial will suggest some things"'
  145. textn '"     to try.  As the editor functions independantly of this"'
  146. textn '"     ARexx tutorial, you may try them immediately.  Simply"'
  147. textn '"     press RETURN when done, as prompted."'
  148. wfs=waitforsub(2)
  149. newline
  150. text  '"     Like now..."';
  151. wfs=waitforsub(2)
  152. response = getreturn('"    Please press the RETURN key..."')
  153.  
  154. clear;wfs=waitforsub(1);newline;newline
  155. textn '"                    What is TEXTRA?"'
  156. textn  '"                ---------------------"'
  157. newline
  158. wfs=waitforsub(1)
  159. text '"     "';textn "It's an Intuition-ized, GUI-based text editor with";
  160. text '"     "';textn "word-processor-like features, complete with a full";
  161. text '"     "';textn "and capable ARexx command set and Script package.";
  162. newline
  163. wfs=waitforsub(2)
  164. textn '"     The emphasis of my efforts has been to make the user"';
  165. textn '"     interface easy-to-use AND powerful."';
  166. newline
  167. wfs=waitforsub(1)
  168. textn '"   Working with the Textra menus, keyboard and ARexx scripts"'
  169. textn '"   is about the best way to get to know it.  Experimentation"'
  170. textn '"   (and registering as a Textra user) is heartily encouraged."'
  171. newline
  172. wfs=waitforsub(1)
  173. response = getreturn('"                 (RETURN to continue)"')
  174. return
  175.  
  176. DoDocs:
  177. clear;wfs=waitforsub(1);newline
  178. textn '"          The Textra Documentation (the Docs drawer)"'
  179. textn '"       ------------------------------------------------"';newline
  180. wfs=waitforsub(1.5)
  181. textn '"     Please refer to the Textra.doc file for detailed information"'
  182. textn '"     about all editor features and facilities."'
  183. newline;wfs=waitforsub(1)
  184. textn '"     If you are interested in programming your own Textra-"'
  185. textn '"     Arexx scripts, the RexxCommand.doc file describes the"'
  186. textn '"     Textra-resident command set."'
  187. newline;wfs=waitforsub(1)
  188. textn '"     For previous Textra users, the complete change history"'
  189. textn '"     contained in WhatsNew.doc may be of interest."'
  190. newline;wfs=waitforsub(1)
  191. textn '"     Additional files are in the `docs` drawer.  A great way"'
  192. textn '"     to become more familiar with Textra is to scan the doc"'
  193. textn '"     files with Textra after the tutorial."'
  194. newline;wfs=waitforsub(1)
  195. response = getreturn('"                     (RETURN to continue)"')
  196. return
  197.  
  198. DoMouseInfo:
  199. clear;wfs=waitforsub(1);newline;newline
  200. textn '"              Use of the mouse in Textra"'
  201. textn '"           --------------------------------"';newline
  202. wfs=waitforsub(1.5)
  203. textn '"       The LEFT MOUSE BUTTON can be used to..."';newline
  204. wfs=waitforsub(2)
  205. textn '"       1. Position the text cursor (see topic 4)"';wfs=waitforsub(1)
  206. textn '"       2. Establish a select range (see topic 5)"';wfs=waitforsub(1)
  207. textn '"       3. Control the window scroll bars (see topic 6)"'
  208. newline;newline;wfs=waitforsub(2)
  209. text  '"  "';textn "The RIGHT MOUSE BUTTON is used to access Textra's menus."
  210. newline
  211. response = getreturn('"               (RETURN to continue)"')
  212. return
  213.  
  214. DoPositionCursor:
  215. clear;wfs=waitforsub(1);newline;newline
  216. textn '"                  The Text Cursor"'
  217. textn '"              ----------------------"';newline
  218. wfs=waitforsub(1.5)
  219. textn '"    The Textra cursor is a vertical bar that always"'
  220. textn '"    lies on the extreme left edge of the character"'
  221. textn '"    position it is occupying."';newline
  222. wfs=waitforsub(1.5)
  223. textn '"    The Textra cursor can be positioned by pointing"'
  224. textn '"    the mouse cursor and clicking the left mouse button"'
  225. textn '"    at the desired location or moved with the keyboard"'
  226. textn '"    arrow keys."';newline
  227. wfs=waitforsub(1.5)
  228. textn '"    Some examples follow..."';newline
  229. response = getreturn('"              (RETURN to continue)"')
  230. gotoxy 0 5;
  231. selectto 0 17
  232.  
  233. textn '"    Placing the cursor..."'
  234. newline
  235. textn '"    While pointing the mouse pointer at some word on"'
  236. textn '"    this page, Single-Click the LEFT MOUSE BUTTON..."'
  237. newline
  238. response = getreturn('"    (Do that several times, then RETURN to continue)"')
  239. gotoxy 0 5;
  240. selectto 0 11
  241.  
  242. textn '"    Moving the cursor..."'
  243. newline
  244. textn '"    Place the text cursor in the middle of a line, then"'
  245. textn '"    experiment with the keyboard arrow-keys..."';newline
  246. response = getreturn('"      (When finished, press RETURN to continue)"')
  247. return
  248.  
  249. DoSelectRanges:
  250. clear;wfs=waitforsub(1);newline;newline
  251. textn '"                Selecting a Range of Text"'
  252. textn '"             -------------------------------"'
  253. newline
  254. wfs=waitforsub(1.5)
  255. textn '"    Any contiguous series of characters may be SELECTED"'
  256. textn '"    in a variety of ways.  As you will later see, such"'
  257. textn '"    a SELECT RANGE is considered a single object; it may"'
  258. textn '"    be CUT, COPIED, PASTED, passed to ARexx scripts"'
  259. textn '"    and more."';
  260. newline
  261. wfs=waitforsub(2)
  262. textn '"    This section illustrates several methods of"'
  263. textn '"    SELECTING TEXT..."';newline
  264. response = getreturn('"             (Press RETURN to continue)"')
  265. gotoxy 0 5;
  266. selectto 0 15
  267.  
  268. textn '"    Selecting a word quickly..."'
  269. newline
  270. textn '"    While pointing the mouse pointer at some word on"'
  271. textn '"    this page, DOUBLE-Click the LEFT MOUSE BUTTON..."';newline
  272. response = getreturn('"     (Do that several times, then RETURN to continue)"')
  273. gotoxy 0 5;
  274. selectto 0 11
  275.  
  276. textn '"    Selecting a line quickly..."'
  277. newline
  278. textn '"    Now try TRIPLE-Clicking the LEFT MOUSE BUTTON on a line..."';newline
  279. response = getreturn('"    (Do that several times, then RETURN to continue)"')
  280. gotoxy 0 5;
  281. selectto 0 10
  282.  
  283. textn '"    Drag-selecting text..."'
  284. newline
  285. textn '"    Place the mouse pointer over some word, then press and"'
  286. textn '"    hold down LEFT MOUSE BUTTON.  Then move the mouse around"'
  287. textn '"    and finally let the LEFT MOUSE BUTTON up."'
  288. newline
  289. response = getreturn('"      (Do that several times, then RETURN to continue)"')
  290. gotoxy 0 5;
  291. selectto 0 12
  292.  
  293. textn '"    Expanding and shrinking a select range..."'
  294. newline
  295. textn '"    Wherever the cursor is at the moment, move the mouse"'
  296. textn '"    pointer over some other word.  Then, while holding "'
  297. textn '"    down the SHIFT key, Single-click the LEFT MOUSE BUTTON."'
  298. newline
  299. response = getreturn('"      (Do that several times, then RETURN to continue)"')
  300. return
  301.  
  302.  
  303. DoScrollBars:
  304. clear;wfs=waitforsub(1);newline;newline
  305. textn '"          Controlling the Window Scroll Bars"'
  306. textn '"       ----------------------------------------"';newline
  307. wfs=waitforsub(1.5)
  308. textn '"    Every Textra window includes vertical and horizontal"'
  309. textn '"    scroll bars which become active as soon as text"'
  310. textn '"    exceeds the visible window dimensions in either"'
  311. textn '"    direction."'
  312. newline;wfs=waitforsub(1.5)
  313. textn '"    They afford continuous scrolling in the appropriate"'
  314. textn '"    direction to make all text visible.  Also, there are"'
  315. textn '"    times when Textra will scroll by itself (such as when"'
  316. textn '"    you try to type off the edge of the window) and the"'
  317. textn '"    scroll bars will reflect such changes."'
  318. newline;wfs=waitforsub(1)
  319. response = getreturn('"                (RETURN to continue)"')
  320. gotoxy 0 5;
  321. selectto 0 17
  322.  
  323. text  '"    Observe the horizontal scroll bar below..."'
  324. waitfor 1
  325. text  '" as this line..."';waitfor 0.8;text '" gets "';waitfor 0.8;
  326. text  '"longer"';waitfor 0.8;text '" and longer"';waitfor 0.8;
  327. text  '" and longer"';waitfor 0.8;text '" and longer"';waitfor 0.8;
  328. text  '" and longer"';waitfor 0.8;text '" and longer"';waitfor 0.8;text '" and longer..."'
  329. waitfor 2;newline;newline;wfs=waitforsub(2)
  330. textn '"    The above line is longer than the window is wide,"'
  331. textn '"    and the horizontal scroll bar reflects that."';newline
  332. wfs=waitforsub(1.5)
  333. textn '"    Go ahead and click on the scroll bar components"'
  334. textn '"    (arrows, slider, non-slider), drag the slider"'
  335. textn '"    around, get a feel for the horizontal window control..."'
  336. newline;wfs=waitforsub(1)
  337. response = getreturn('"        (Press RETURN when finished experimenting)"')
  338. gotoxy 0 5;
  339. selectto 0 15
  340.  
  341. textn '"    Lets illustrate both scroll bars in action..."';newline
  342. wfs=waitforsub(1.5)
  343. textn '"    This window will soon fill with enough text such"'
  344. textn '"    that both scroll bars will activate."';newline
  345. wfs=waitforsub(1.5)
  346. textn '"    Once it does, play with both scroll bars, moving the"'
  347. textn '"    text around.  When finished experimenting, press"'
  348. textn '"    RETURN."';newline
  349. wfs=waitforsub(1.5)
  350. get cursor position; parse var result cx cy;
  351. response = getreturn('"     (Press RETURN to activate both scroll bars)"')
  352. gotoxy 0 cy;selectto 0 cy+1
  353. del
  354. newline;newline;newline;newline;
  355. textn '"    Four score and seven years ago, our forefathers brought forth upon this continent"'
  356. textn '"    a new nation, dedicated to the proposition that all men are created equal.  We hold"'
  357. textn '"    these truths to be self-evident..."';newline;newline;newline
  358. response = getreturn('"                (Press the RETURN key when finished experimenting)"')
  359. return
  360.  
  361. DoSelectTextInfo:
  362. clear;wfs=waitforsub(1);newline;newline
  363. textn '"           Working with selected ranges of text"'
  364. textn '"        ------------------------------------------"';newline
  365. wfs=waitforsub(1.5)
  366. textn '"    Once a section of text is SELECTED (see topic 5),"'
  367. textn '"    it may be CUT or COPIED into a Textra internal buffer."'
  368. textn '"    Then, after putting the text cursor in another place"'
  369. textn '"    (perhaps even in a different Textra window), PASTE"'
  370. textn '"    the copied text there."';newline
  371. wfs=waitforsub(1.5)
  372. textn '"    To illustrate, select any section of text in the"'
  373. textn '"    preceeding paragraph, then press Right-Amiga-C (copy)."'
  374. textn '"    Position the cursor just past the paragraph and press"'
  375. textn '"    Right-Amiga-V (paste)."'
  376. newline;wfs=waitforsub(1)
  377. response = getreturn('"              (Press RETURN when finished)"')
  378. clear;newline;newline
  379. textn '"           Working with SELECTED RANGES of text"'
  380. textn '"        ------------------------------------------"';newline
  381. wfs=waitforsub(1.5)
  382. textn '"    When a SELECT RANGE exists, the DEL and BACKSPACE keys"'
  383. textn '"    on the keyboard work similar to the CUT operation,"'
  384. textn '"    except that the removed text is NOT saved in the"'
  385. textn '"    internal Textra buffer."'
  386. newline;wfs=waitforsub(1)
  387. response = getreturn('"                 (Press RETURN to continue)"')
  388. return
  389.  
  390. DoPrefs:
  391. clear;wfs=waitforsub(1);newline;newline
  392. textn '"             Textra Preference Settings"'
  393. textn '"          --------------------------------"';newline
  394. wfs=waitforsub(1.5)
  395. textn '"    Textra provides a set of user-configurable Preference"'
  396. textn '"    settings which can be saved to disk such that they will"'
  397. textn '"    be re-assumed whenever Textra starts-up."'
  398. newline;wfs=waitforsub(1.5)
  399. textn '"    Optionally, these settings may be invoked temporarily"'
  400. textn '"    without being saved to disk."'
  401. newline;wfs=waitforsub(1.5)
  402. textn '"    The settings are grouped into 3 areas of use:"'
  403. newline;wfs=waitforsub(1)
  404. textn '"                1. Printing Preferences"';wfs=waitforsub(1)
  405. textn '"                2. Editing Preferences"';wfs=waitforsub(1)
  406. textn '"                3. Font Preferences"';wfs=waitforsub(1)
  407. newline;wfs=waitforsub(1.5)
  408. response = getreturn('"              (Press RETURN to continue)"')
  409.  
  410. clear;wfs=waitforsub(1);newline;newline
  411. textn '"               Textra Printing Preferences"'
  412. textn '"            ---------------------------------"'
  413. newline;wfs=waitforsub(1.5)
  414. textn '"    Under the Project menu is the Printing Preferences... item."'
  415. textn '"    Pull it down now and observe the various settings available."'
  416. textn '"    Then press the CANCEL button on the requester."'
  417. newline;wfs=waitforsub(1.5)
  418. textn '"    Refer to Textra.doc for more information about any of the"'
  419. textn '"    available Printing Preference settings."'
  420. newline;wfs=waitforsub(1.5)
  421. response = getreturn('"         (When finished, press RETURN to continue)"')
  422.  
  423. clear;wfs=waitforsub(1);newline;newline
  424. textn '"                 Textra Editing Preferences"'
  425. textn '"              --------------------------------"'
  426. newline;wfs=waitforsub(1.5)
  427. textn '"    Under the Edit menu is the Editing Preferences... item."'
  428. textn '"    Pull it down now and observe the various settings available."'
  429. textn '"    Then press the CANCEL button on the requester."'
  430. newline;wfs=waitforsub(1.5)
  431. textn '"    Refer to Textra.doc for more information about any of the"'
  432. textn '"    available Editing Preferences."'
  433. newline;wfs=waitforsub(1.5)
  434. response = getreturn('"         (When finished, press RETURN to continue)"')
  435.  
  436. clear;wfs=waitforsub(1);newline;newline
  437. textn '"                   Textra Font Preferences"'
  438. textn '"                -----------------------------"'
  439. newline;wfs=waitforsub(1.5)
  440. textn '"    Under the Utilities menu is the Font Preferences... item."'
  441. textn '"    This item will be enabled if the asl.library (usually"'
  442. textn '"    associated with WB2.0 and later) is available on your"'
  443. textn '"    system."'
  444. newline;wfs=waitforsub(1.5)
  445. textn '"    Currently, the only save-able Preference setting is"'
  446. textn '"    the specification of which font to use for newly-opened"'
  447. textn '"    Textra windows."'
  448. newline;wfs=waitforsub(1.5)
  449. textn '"    If enabled, pull it down now and experiment.  Then press"'
  450. textn '"    the CANCEL button on the requester."'
  451. newline;wfs=waitforsub(1.5)
  452. response = getreturn('"         (When finished, press RETURN to continue)"')
  453. return
  454.  
  455. DoFonts:
  456. clear;wfs=waitforsub(1)
  457. newline;newline
  458. text  '"                 "';textn "Textra's use of fonts"
  459. textn '"              ---------------------------"';newline
  460. wfs=waitforsub(1.5)
  461. textn '"    Every Textra window may have a different fixed-space"'
  462. textn '"    font.  Under the Utilities... menu is the Set Window"'
  463. textn '"    Font item.  This item will be enabled if the asl.library"'
  464. textn '"    (usually associated with WB2.0 and later) is available"'
  465. textn '"    on your system."'
  466. newline; wfs=waitforsub(1.5)
  467. textn '"    Feel free to experiment with it now.  Note that the"'
  468. textn '"    tutorial will reset the tutorial font to Topaz 8 when"'
  469. textn '"    you continue from this screen, as the page-formatting"'
  470. textn '"    routines of this script are designed for that size."'
  471. newline;wfs=waitforsub(1)
  472. response = getreturn('"                   (RETURN to continue)"')
  473. clear
  474. setfont Topaz 8
  475. return
  476.  
  477. DoARexx:
  478. clear;wfs=waitforsub(1);newline
  479. textn '"                 The Textra-ARexx Interface"'
  480. textn '"              --------------------------------"'
  481. newline;wfs=waitforsub(1.5)
  482. textn '"    Almost sounds like a new TV Space show, eh?"'; newline
  483. textn '"    Textra opens an ARexx port called (appropriately) TEXTRA."'
  484. textn '"    The resident 70+ command set provides a range of features:"'
  485. newline
  486. textn '"       ...from manipulating window text...  to window and file"'
  487. textn '"       management... interactivity with the TEXTRA user..."'
  488. textn '"       interactivity with other programs..."'
  489. newline
  490. textn '"    (this tutorial, remember, is but a Textra-ARexx script)"'
  491. newline;wfs=waitforsub(1.5)
  492. textn '"    Refer to Textra.doc for information on running scripts."'
  493. wfs=waitforsub(1.5)
  494. textn '"    Refer to RexxCommand.doc for information on writing scripts."'
  495. newline;wfs=waitforsub(1.5)
  496. response = getreturn('"               (Press RETURN to continue)"')
  497. gotoxy 0 4;
  498. selectto 0 19
  499. textn '"    The Textra package also includes 30+ ARexx scripts that"'
  500. textn '"    are quite varied in scope.  A quick example... say"'
  501. textn '"    we hastily type in the following outline:"'
  502. newline;wfs=waitforsub(1.5)
  503. textn '"    A. GM cars"'
  504. newline
  505. textn '"    1. Buick"'
  506. textn '"    2. Cadillac"'
  507. textn '"    3. Chevrolet"'
  508. textn '"    4. Oldsmobile"'
  509. textn '"    5. Pontiac"'
  510. newline;
  511. textn '"    OOPS... we forgot to indent the car names..."'
  512. newline;wfs=waitforsub(1.5)
  513. response = getreturn('"               (Press RETURN to continue)"')
  514. gotoxy 0 4
  515. selectto 0 5;del;selectto 0 5;del;selectto 0 5;del;
  516. gotoxy 0 15;selectto 0 16;del
  517. /***********************************************************************
  518. * wfs=waitforsub(1.5)                                                  *
  519. ***********************************************************************/
  520. waitfor 1.0
  521. get cursor position;parse var result cx cy
  522. textn '"    By use of the Textra/ARexx command:    slide 3"'
  523. textn '"    one can easily correct the problem..."'
  524. newline;wfs=waitforsub(1.5)
  525. response = getreturn('"        (Press RETURN to see what that does)"')
  526. gotoxy 0 cy-2;selectto 0 cy+4;del
  527. wfs=waitforsub(1.5)
  528. /*
  529. ** this does the same as the slide script does, and doesn't require
  530. ** that script to be in REXX:, so the tutorial works
  531. ** on systems that heven't installed the scripts.
  532. */
  533. gotoxy 0 7;selectto 0 12;waitfor 1;gotoxy 0 7
  534. ii = 0
  535. do while (ii < 5)
  536.    text '"   "'
  537.    left 3  /*column 0*/
  538.    down 1
  539.    ii = ii + 1
  540. end
  541. gotoxy 0 7;selectto 0 12;waitfor 1
  542. gotoxy 0 12;newline;wfs=waitforsub(2.0)
  543. response = getreturn('"                 (Press RETURN to continue)"')
  544. return
  545.  
  546. DoReg:
  547. clear;wfs=waitforsub(1);newline;newline
  548. textn '"                    No Registration anymore!"'
  549. textn '"                -------------------------------"'
  550. newline;wfs=waitforsub(1)
  551. textn '"    I hope you find Textra a professional-quality text editor."'
  552. textn '"    Many suggestions from users have gone into Textra which"'
  553. textn '"    have helped it to become a popular tool."'
  554. newline;wfs=waitforsub(1.5)
  555. textn '"    For example, this version sports undo, multi-processing,"'
  556. textn '"    ASL font support, interactivity with SAS/C and HSPascal,"'
  557. textn '"    ARexx interactivity with the user, and much more."'
  558. newline;wfs=waitforsub(1.5)
  559. textn '"       And being FREE, who can ask for a better deal?"'
  560. newline;wfs=waitforsub(1.5)
  561. response = getreturn('"                   (Press RETURN to continue)"')
  562. gotoxy 0 5;
  563. selectto 0 16
  564.  
  565. cut
  566.  
  567. waitfor .5
  568. textn '"       So give it me a try... at this price, why not?  :-)"'
  569. newline
  570. newline
  571. newline
  572. newline
  573. newline;newline
  574. get cursor position;parse var result cx cy
  575. waitfor 1
  576. text '"                "';textn "WE MIGHT EVEN LIKE EACH OTHER..."
  577. i = 0
  578. do while (i < 3)
  579.    waitfor 0.5
  580.    gotoxy 16 cy;selectto 48 cy
  581.    waitfor 0.5
  582.    unselect;right 1
  583.    i = i+1
  584. end
  585. prefs AlphanumericHops read;ahops = result
  586. prefs AlphanumericHops off
  587. gotoxy 0 cy
  588. i = 0
  589. do while (i < 6)
  590.    waitfor 0.1
  591.    hopselect next word
  592.    i = i+1
  593. end
  594. i = 0
  595. do while (i < 5)
  596.    waitfor 0.1
  597.    hopselect prev word
  598.    i = i+1
  599. end
  600. i = 0
  601. do while (i < 5)
  602.    waitfor 0.1
  603.    hopselect next word
  604.    i = i+1
  605. end
  606. i = 0
  607. do while (i < 1)
  608.    waitfor 0.1
  609.    hopselect prev word
  610.    i = i+1
  611. end
  612. prefs AlphanumericHops ahops
  613. down 2
  614.  
  615. newline;newline;wfs=waitforsub(1.5)
  616. response = getreturn('"                   (press RETURN to continue)"')
  617. return
  618.  
  619. DoByeBye:
  620. prefs autoindent wasai
  621. notify "end of script"
  622. exit
  623. return
  624.  
  625. getreturn:
  626.     parse arg theprompt
  627.     checkcancel
  628.     if (result == CANCEL) then do
  629.         notify "Tutorial canceled."
  630.         prefs autoindent wasai
  631.         CloseWindow
  632.         exit
  633.     end
  634.     returnprompt theprompt
  635. return result
  636.  
  637. waitforsub:
  638.    parse arg wfval
  639.    if (delay == "delay") then
  640.       waitfor wfval
  641. return wfval
  642.